package service

import (
	"context"
	__ "goods-server/basic/proto"
	"goods-server/handler/model"
)

// 订单
func (s *Server) GetOrder(_ context.Context, in *__.GetOrderReq) (*__.GetOrderResp, error) {
	var err error
	var o model.Order
	o = model.Order{
		UserId: int32(in.UserId),
		GoodId: int32(in.GoodsId),
		Status: in.Status,
	}
	err = o.OrderCreate()
	if err != nil {
		return &__.GetOrderResp{
			Msg:  "订单失败",
			Code: 400,
		}, nil
	}

	return &__.GetOrderResp{
		Msg:  "状态同步成功",
		Code: 200,
	}, nil
}
